import { ApiProperty } from '@nestjs/swagger';
import {
  IsArray,
  IsNumber,
  IsOptional,
  IsString,
  Max,
  Min,
} from 'class-validator';

export class UpdateHotelDto {
  @ApiProperty({
    description: '酒店名称',
    example: '香格里拉酒店',
    required: false,
  })
  @IsString()
  @IsOptional()
  name?: string;

  @ApiProperty({
    description: '酒店地址',
    example: '北京市朝阳区建国门外大街1号',
    required: false,
  })
  @IsString()
  @IsOptional()
  address?: string;

  @ApiProperty({
    description: '星级评分 (1-5)',
    example: 5,
    minimum: 1,
    maximum: 5,
    required: false,
  })
  @IsNumber()
  @Min(1, { message: '星级评分最低为1星' })
  @Max(5, { message: '星级评分最高为5星' })
  @IsOptional()
  starRating?: number;

  @ApiProperty({
    description: '酒店房间列表',
    example: [],
    type: [Object],
    required: false,
  })
  @IsArray()
  @IsOptional()
  rooms?: any[];
}
